//
//  RegisterView.m
//  liBaQiang
//
//  Created by 奇林刘 on 2018/10/19.
//  Copyright © 2018年 liu. All rights reserved.
//

#import "RegisterView.h"

@interface RegisterView ()

@end

@implementation RegisterView

- (void)configSelf {
    self.fp_backgroundColor(HexadecimalColor(@"#F5F6F8"));
}

- (void)allocateComponents {
    self.fp_addSubview(self.nameField = [[RegisterView_FieldView alloc] initWithTitle:@"姓名" placeholder:@"请输入姓名"]);
    [self.nameField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self);
        make.top.equalTo(self).offset(RPX(15));
    }];
    
    self.fp_addSubview(self.passwordField = [[RegisterView_FieldView alloc] initWithTitle:@"密码" placeholder:@"请输入账号登录密码"]);
    [self.passwordField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self);
        make.top.equalTo(self.nameField.mas_bottom).offset(RPX(11));
    }];
    
    self.fp_addSubview(self.phoneField = [[RegisterView_FieldView alloc] initWithTitle:@"手机" placeholder:@"请输入联系手机号"]);
    [self.phoneField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self);
        make.top.equalTo(self.passwordField.mas_bottom).offset(RPX(11));
    }];
    
    self.fp_addSubview(self.verificationField = [[RegisterView_FieldView alloc] initWithTitle:@"验证码" placeholder:@"请输入验证码"]);
    [self.verificationField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self);
        make.top.equalTo(self.phoneField.mas_bottom).offset(RPX(11));
    }];
    
    self.fp_addSubview(self.requestVerificationButton = [[UIButton alloc] init]);
    [self.requestVerificationButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.verificationField);
        make.right.equalTo(self).offset(RPX(-15));
    }];
    
    self.fp_addSubview(self.registerButton = [[UIButton alloc] init]);
    [self.registerButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self);
        make.top.equalTo(self.verificationField.mas_bottom).offset(RPX(22));
        make.width.equalTo(@(RPX(345)));
        make.height.equalTo(@(RPX(44)));
    }];
}

- (void)configComponents {
    [self.requestVerificationButton setTitle:@"发送验证码" forState:UIControlStateNormal];
    [self.requestVerificationButton setTitleColor:HexadecimalColor(@"#275FB2") forState:UIControlStateNormal];
    [self.requestVerificationButton.titleLabel setFont:RPXFont(14)];
    [self.registerButton setTitle:@"立即注册" forState:UIControlStateNormal];
    [self.registerButton.titleLabel setFont:RPXFont(16)];
    self.registerButton.fp_cornerRadius(RPX(4)).fp_backgroundColor(HexadecimalColor(@"#2D5898"));
}



@end
